import requests


headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
    'Referer': 'https://www.xiaohua.com/hot/',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}
# 登录请求的url地址
url = 'https://www.xiaohua.com/Handler/Login.ashx'
# 登录要用到的用户名和密码
data = {
    'username': 'luckyboy',
    'password': 'luckyboy'
}
# 发起请求
res = requests.post(url, data=data, headers=headers)
# 获取响应的cookie
print(dict(res.cookies))
cookies = requests.utils.dict_from_cookiejar(res.cookies)
print(cookies)
